package com.zj.ckproxy.handler;

import com.zj.baseproxy.handler.AbstractXmlInvocationHandler;
import com.zj.baseproxy.model.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.Configuration;

import javax.annotation.Resource;

/**
 * ck动态代理
 *
 * @author arthur_zhou
 * @date 2024/2/28 14:32
 */
@Slf4j
public class CkInvocationHandler extends AbstractXmlInvocationHandler {

    private final String url;
    @Resource
    private CkHandler ckHandler;

    public CkInvocationHandler(String url, Configuration configuration) {
        super(configuration);
        this.url = url;
    }

    @Override
    public <T> T packagePage(String id, String sql, Class<?> xmlResultType, Class<T> returnType, PageInfo pageInfo) {
        return ckHandler.packagePage(id, url, sql, xmlResultType, returnType, pageInfo);
    }

}
